Skip to content

fix(ci): sync secret-scanner.yml from the template; stop echoing matched credential lines - #7

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/secret-scanner-template-sync
Nov 14, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/secret-scanner-template-sync

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Syncs .github/workflows/secret-scanner.yml from hyperpolymath/rsr-template-repo at d183b32 (template fixes #332 and #363). The owner approved this sync ahead of the staged rollout, after a dry-run of the exact diff.

Changes

This is the whole diff (one file, +17 / -6). Nothing else changes.

  • Standards helper pin e064539 -> f0b3cd4 (3 lines). f0b3cd4 is reachable from standards main (checked: main is 58 commits ahead of it).
  • Matched lines are reported as file:line only, so a matched credential is no longer echoed to the Actions log.
  • The credential regex gains quoted-literal *_TOKEN=, *_API_KEY=, *_SECRET= and PASSWORD= detection (values containing $ are excluded, so "${VAR}" never matches).

No uses: line changes, so actions.lock is untouched.

Not touched: .github/workflows/security-policy.yml also contains a "hardcoded" pattern; I did not read it closely and have not changed it.

Note: main has one merge commit (81b6d8b, 2026-10-20, not from this PR). Merge this PR by squash or rebase only, so no merge commit is added.

RSR Quality Checklist

Required

  • Tests pass: not run locally; the repo's own CI runs on this PR
  • No banned language patterns
  • No secrets, credentials, or .env files included
  • SPDX header unchanged (the file is a copy of the template's; no licence edits)

Testing

The diff was compared against the template file (diff shows exactly the changes above and nothing else). The workflow itself runs on this PR; I will check its result before anything is claimed.


Generated by Claude Code

Summary by CodeRabbit

  • Improvements
    • Secret scan results now include file and line numbers without displaying matched source text.
    • Shell-secret scanning recognizes additional quoted token, API key, secret, and password assignments.
    • Updated the security standards baseline reference.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T18:02:13.025265Z 925f212 New commits
🔒 Security Review ✅ Completed 2026-11-14T18:03:24.330468Z 925f212 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 2 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f5dfdca and 925f212.

Files selected for processing: 1

  • .github/workflows/secret-scanner.yml

No actionable comments were generated in the recent review.

Walkthrough

The secret-scanner workflow updates its standards baseline pin. It also adds shell-scan patterns for quoted secret and password assignments and changes Rust-scan output to withhold matched source text.

Changes: Secret scanner workflow

Layer / File(s) Summary
Standards baseline pin
.github/workflows/secret-scanner.yml
The documented standards pin, STANDARDS_SHA, and baseline checkout ref use the updated commit.
Secret scan detection and reporting
.github/workflows/secret-scanner.yml
Rust-scan findings show file and line numbers without matched source text. The shell scan adds patterns for quoted token, API-key, secret, and password assignments, and continues to report matching filenames.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · previous review f5dfd

This updates the secret scanner workflow so it no longer prints matched credential lines in CI logs and detects more quoted credential assignments. It carries minimal merge risk; confirm the repository CI run passes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two main changes: the template sync of secret-scanner.yml and the stop of echoing matched credential lines. The raw summary confirms both changes. The title is specific and accurat…
Description check Passed The description follows the template's main sections: Summary, Changes, RSR Quality Checklist, and Testing. It explains the template sync, the helper pin update, the file-and-line-only reporting, and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: the template sync of secret-scanner.yml and the stop of echoing matched credential lines. The raw summary confirms both changes. The title is specific and accurate, though long at 89 characters.

Full details: Description check

Explanation

The description follows the template's main sections: Summary, Changes, RSR Quality Checklist, and Testing. It explains the template sync, the helper pin update, the file-and-line-only reporting, and the new quoted-literal patterns. It marks the applicable checklist items. It omits the Screenshots section, which is optional. It leaves several Required items unchecked or unaddressed, including tests not run locally and the lint and formatting items, which are not mentioned. Those items are not applicable to a single YAML workflow file, but the author does not say so.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 562df99 and f5dfdca.

Files selected for processing: 1

  • .github/workflows/secret-scanner.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5dfdcaed8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# exclude '$', so ="${VAR}" and ="$VAR" never match. Only file names
# are listed, never the matched text.
SQ="'"
ASSIGN="[A-Z_]*(TOKEN|API_KEY|SECRET)[A-Z_]*=[\"${SQ}][A-Za-z0-9_./+=-]{16,}[\"${SQ}]|PASS[W]ORD=[\"${SQ}][^\"${SQ}\$]{6,}[\"${SQ}]"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*P2 Badge Match generic _KEY assignments

When a credential is stored under a common name such as AUTH_KEY="abcdefghijklmnop" or ENCRYPTION_KEY="abcdefghijklmnop", this expression does not match it: the alternation accepts only the literal API_KEY, despite the surrounding comment and commit contract claiming support for *_KEY. Such values also need not match any provider-specific prefix, so the shell-secrets pass can report clean; include a generic KEY alternative (with the intended naming boundaries).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gap is real: the expression matches API_KEY but not AUTH_KEY or ENCRYPTION_KEY. I traced it to the template (rsr-template-repo secret-scanner.yml, ASSIGN), and the canonical secret-scanner-reusable.yml in standards has the same restriction ([A-Z_]*API_KEY[A-Z_]*) despite its comment saying *_KEY. I'm not widening the regex only in this copy: it would diverge from the template and show up as drift on the next sync. The fix belongs at source (standards reusable first, then the template mirrors it), so I'm taking it to the owner as a separate change. This thread stays open until that is decided.


Generated by Claude Code

Comment thread .github/workflows/secret-scanner.yml Resolved
hyperpolymath added a commit to metadatastician/standards that referenced this pull request Nov 14, 2026
…es, not only API_KEY (#1570)

## What

The `shell-secrets` step's own comment says `*_TOKEN / *_KEY / *_SECRET
/ PASSWORD`, but its key pattern was `API_KEY` only. So `AUTH_KEY="…"`
and `ENCRYPTION_KEY="…"` read clean. Codex found this on
hyperpolymath/zig-unorm#7; the owner chose to fix it at source (here
first, then the rsr-template-repo inline scanner mirrors it).

## Change

- `secret-scanner-reusable.yml`: the key pattern now covers `API`,
`AUTH`, `ACCESS`, `ENCRYPTION`, `SIGNING`, `PRIVATE` and `MASTER`
`_KEY`. A bare `[A-Z_]*_KEY` is deliberately not used: it would also hit
`PUBLIC_KEY`, `SORT_KEY`, `CACHE_KEY` and `PRIMARY_KEY`.
- `tests/test_secret_scanner_canary.sh`: a new section plants four
credential-style key literals and counts all four; plants
`PUBLIC_KEY`/`SORT_KEY`/`CACHE_KEY` and `${VAR}`/`$VAR` references and
requires a clean run. It extracts the real step body with `yq`, like the
existing Rust canary.

## Evidence

- I ran the shipping step body (extracted with `awk`, not `yq`, since
`yq` is not available in my environment) against those fixtures. The old
reusable (`origin/main`) reports 1 of 4 planted secrets; this change
reports 4 of 4. Both are clean on the non-secret fixtures. The new
canary section would therefore fail on the old reusable.
- The `yq`-based canary harness itself was **not** run by me; CI runs
it.
- Blast radius, measured with a `grep` equivalent of the old and new key
patterns over `*.sh`/`*.bash` in the 8 repo clones I had (standards,
rsr-template-repo, cicd-squabbler, zig-unorm, fumble, gitbot-fleet
(partial clone), ZeroInflatedCounts.jl, ResidualEvidenceTypes.jl): old 0
matches, new 0 matches in each. That is 8 repos, not the estate;
consumers pinned by SHA do not change until their pin moves.

## Not in this PR

The rsr-template-repo inline scanner (`ASSIGN`, `*_API_KEY`) and the
copies synced from it have the same gap. They mirror this file, so they
follow in a separate change after this lands.

---
_Generated by [Claude
Code](https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
…hed credential lines

Replaces the inline scanner with rsr-template-repo d183b32's copy. The only
differences: standards helper pin e064539 -> f0b3cd4 (reachable from standards
main); matched lines are reported as file:line only, so a credential is not
printed to the Actions log; the credential regex gains quoted-literal
*_TOKEN=/*_API_KEY=/*_SECRET=/PASSWORD= detection. No uses: line changes, so
actions.lock is untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU
The template file moved the scanner to standards f0b3cd4, but this repo's other
workflows (governance.yml) still use e064539, and the file's own contract says
the scanner pin must match every other workflow's. Keep e064539 here; the
credential-echo fix and the extended detection do not depend on the pin. The
whole-repo pin move is the applier's job and lands in one change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7Zmiut2nCcbtEx25HAU
@hyperpolymath
hyperpolymath force-pushed the claude/secret-scanner-template-sync branch from 979f8af to 925f212 Compare November 14, 2026 18:00
@hyperpolymath
hyperpolymath merged commit a2d876e into main Nov 14, 2026
36 of 37 checks passed
@hyperpolymath
hyperpolymath deleted the claude/secret-scanner-template-sync branch November 14, 2026 18:00
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants